﻿using System;
using System.Collections.Generic;
using System.Linq;
using C3.Proto.Core.Model;
using C3.Proto.Core.Repository;
using SubSonic.Schema;
using SubSonic.DataProviders;

namespace C3.Proto.Repo
{
    public class UserRepository : RepositoryBase, IUserRepository
    {

        public User GetUserByEmail(string email)
        {
            return repo.Single<User>(t => t.Email == email);
        }

        public void ClaimsImport()
        {
            var sproc = new StoredProcedure("ClaimsImport", ProviderFactory.GetProvider("DBO2Safety"));
            sproc.Execute();
            
        }
        public void RirImport()
        {
            var sproc = new StoredProcedure("RIRImport", ProviderFactory.GetProvider("DBO2Safety"));
            sproc.Execute();
        }
        public void ManhoursImport()
        {
            var sproc = new StoredProcedure("ManhoursImport", ProviderFactory.GetProvider("DBO2Safety"));
            sproc.Execute();
        }
        public void StepImport()
        {
            var sproc = new StoredProcedure("StepImport", ProviderFactory.GetProvider("DBO2Safety"));
            sproc.Execute();
        }
    }
}
